{~ui('loader')->css('@pay.selector')}
{eval
$me_money = round(user()->get('money')*1, 2);
$allowSelfPay = false;
$pay_money = round($pay_money, 2);
$remain_money = round(($pay_money - $me_money),2);
$dspSelfPay = $product_type == 'recharge' ? false : true;
}
<div id="paytype_list" class="common-title">
<p class="title"></p>
<section class="common-items">	
				<div class="common-item" id="total_money">
					<span class="item-label">账户余额：</span>
					<div class="item-content f16">&yen; {$me_money} 元</div>
				</div>
{if $dspSelfPay}
<div class="common-item common-radio-accbal" style="padding-left: 120px;"> 
<span class="item-label" style="width:100px;text-align:left;"> 使用余额支付：</span>

{if $me_money > 0 && $me_money < $pay_money}
<label for="payment_use_surplus"  id="lable_surplus">
<input type="checkbox" id="payment_use_surplus"  value="true" />
 <i></i> 
</label>

{elseif $me_money >= $pay_money}
{eval $allowSelfPay = true}
可以使用余额付款
{/if}

{/if}
</div>
{if $dspSelfPay}
<div class="common-item">
<font id="payment_total_money">您总共需要支付{$pay_money}元</font>
<input type="hidden" id="totalmoney_2" value="{$pay_money}">
<font id="payment_remain_money">扣除{$me_money}元后，还需支付{$remain_money}元</font>
<div id="payment_clear"></div>
</div>
{/if}
</section>




<div class="common-title">选择付款方式</div>
<section class="common-items common-radio-box">

{if $product_type == 'recharge'}{eval $allowSelfPay = false}{/if}
{if $product_id}
{eval $listString = meta('paymentlist_of_'.$product_id)}
{else}
{eval $listString = false}
{/if}
{loop logic('pay')->GetList() $i $pay}
{if !$allowSelfPay && $pay['code'] == 'self'}
{eval continue}
{/if}
{if $pay['code'] == 'cod' && $product_type != 'stuff'}
{eval continue}
{/if}
{if $pay_money <=0 && $pay['code'] != 'self'}
{eval continue}
{/if}
{if $product_type == 'recharge' && $pay['code'] == 'bank'}
{eval continue}
{/if}
{if $product_type != 'recharge' && $pay['code'] == 'recharge'}
{eval continue}
{/if}
{if $listString}
{if !stristr($listString, $pay['code'].',')}
{eval continue}
{/if}
{/if}




<div class="common-item add-click">
								<label for="payment_id_{$pay['id']}"><font color="#333">{$pay['name']}</font>
									<input id="payment_id_{$pay['id']}" name="payment_id" type="radio" value="{$pay['id']}" />
									<i></i>
								</label>
</div>



{/loop}

</section>

</div>
<script type="text/javascript">
$(document).ready(function() {

	 $("#payment_use_surplus").change(function() {
		if($("#payment_use_surplus").is(':checked')){
			$("#lable_surplus").attr("class","checked");
			
	 	}else{
	 		$("#lable_surplus").removeAttr("class");
		} 
	 });
});

</script>
{~ui('loader')->js('@pay.selector')}